package com.shijiwei.lifthelper.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.shijiwei.lifthelper.R;
import com.shijiwei.lifthelper.ui.CookCategoryActivity;

import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.Event;

/**
 * Created by sjw on 2015/12/12.
 */
@ContentView(R.layout.fragment_cookbook)
public class CookBookFragment extends BaseFragment {

    public static CookBookFragment newInstance() {
        CookBookFragment fragment = new CookBookFragment();
        return fragment;
    }
    @Override
    public void initView() {

    }

    @Override
    public void initData() {

    }

    @Event(value = {R.id.ll_cook_category_family,R.id.ll_cook_category_create,R.id.ll_cook_category_hp
    ,R.id.ll_cook_category_liang,R.id.ll_cook_category_ms,R.id.ll_cook_category_quick,R.id.ll_cook_category_su})
    private void onTextViewClick(View view){
        TextView tv = null;
        switch(view.getId()){
            case R.id.ll_cook_category_family:
                tv = (TextView) view.findViewById(R.id.tv_cook_category_family);
                break;
            case R.id.ll_cook_category_create:
                tv = (TextView) view.findViewById(R.id.tv_cook_category_create);
                break;
            case R.id.ll_cook_category_hp:
                tv = (TextView) view.findViewById(R.id.tv_cook_category_hp);
                break;
            case R.id.ll_cook_category_liang:
                tv = (TextView) view.findViewById(R.id.tv_cook_category_liang);
                break;
            case R.id.ll_cook_category_ms:
                tv = (TextView) view.findViewById(R.id.tv_cook_category_ms);
                break;
            case R.id.ll_cook_category_quick:
                tv = (TextView) view.findViewById(R.id.tv_cook_category_quick);
                break;
            case R.id.ll_cook_category_su:
                tv = (TextView) view.findViewById(R.id.tv_cook_category_su);
                break;
        }
        Intent intent = new Intent(getActivity(), CookCategoryActivity.class);
        intent.putExtra("category",tv.getText());
        startActivity(intent);
    }
}
